//
//  MessageViewController.m
//  ZiJinLian
//
//  Created by 🐛 on 2017/4/18.
//  Copyright © 2017年 lzy. All rights reserved.
//

#import "MessageViewController.h"
#import "EaseConversationListViewController.h"
@interface MessageViewController ()<UITableViewDelegate,UITableViewDataSource>

@property (nonatomic ,strong) UITableView * tableView;
@property (nonatomic ,strong) NSArray     * imgArry;
@property (nonatomic ,strong) NSArray     * nameArry;
@end

@implementation MessageViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title=@"通知消息";
    self.tableView=[[UITableView alloc]initWithFrame:CGRectMake(0, 0, MainW, MainH) style:UITableViewStylePlain];
    self.tableView.delegate=self;
    self.tableView.dataSource=self;
    self.tableView.separatorStyle=0;
    self.tableView.backgroundColor=Gray_Color;
    [self.view addSubview:self.tableView];
    self.imgArry=[NSArray arrayWithObjects:@"icon_logistics",@"icon_inform",@"icon_customer_service", nil];
    self.nameArry=[NSArray arrayWithObjects:@"物流消息",@"通知",@"客服人员", nil];
    // Do any additional setup after loading the view.
}
-(CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section{
    return 1;
}
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
    return 3;
}
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    return 60;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return 1;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    static NSString *CellIdentifier = @"Cell";
    UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];
    if (cell == nil) {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
    }
    cell.imageView.image=[UIImage imageNamed:self.imgArry[indexPath.section]];
    cell.textLabel.text=self.nameArry[indexPath.section];
    cell.textLabel.textColor=TextColor3;
    cell.textLabel.font=FontAndStyle14;
    cell.selectionStyle=0;
    return cell;
}
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    switch (indexPath.section) {
        case 0:
        {
            //NSLog(@"物流");
        }
            break;
        case 1:
        {
            //NSLog(@"通知");
        }
            break;
        case 2:
        {
            EaseConversationListViewController *chatController = [[EaseConversationListViewController alloc]init];
            chatController.title=@"消息";
            [self.navigationController pushViewController:chatController animated:YES];
        }
            break;
            
        default:
            break;
    }
}


@end
